SET(PHYSX_FOUND "NO")
SET(PHYSX_INCLUDE_DIR "NOTFOUND")
SET(PHYSX_LIBRARIES "NOTFOUND")

IF(WIN32)
	SET(PX_INC	"C:\\Program Files\\NVIDIA Corporation\\NVIDIA PhysX SDK\\v2.8.1\\SDKs")
	SET(PHYSX_NXCOOKING_LIBRARY "C:\\Program Files\\NVIDIA Corporation\\NVIDIA PhysX SDK\\v2.8.1\\SDKs\\lib\\Win32\\NxCooking.lib")
	SET(PHYSX_NXCHARACTER_LIBRARY "C:\\Program Files\\NVIDIA Corporation\\NVIDIA PhysX SDK\\v2.8.1\\SDKs\\lib\\Win32\\NxCharacter.lib")
	SET(PHYSX_PHYSXLOADER_LIBRARY "C:\\Program Files\\NVIDIA Corporation\\NVIDIA PhysX SDK\\v2.8.1\\SDKs\\lib\\Win32\\PhysXLoader.lib")
	SET(PHYSX_LIBRARIES ${PHYSX_NXCOOKING_LIBRARY} ${PHYSX_NXCHARACTER_LIBRARY} ${PHYSX_PHYSXLOADER_LIBRARY} )
	SET(PHYSX_FOUND	"YES")
ENDIF(WIN32)

IF(UNIX)
	SET(PX_INC	"/usr/include/PhysX/v2.8.1/SDKs")
	SET(PHYSX_NXCOOKING_LIBRARY "/usr/lib/PhysX/v2.8.1/libNxCooking.so")
	SET(PHYSX_NXCHARACTER_LIBRARY "/usr/lib/PhysX/v2.8.1/libNxCharacter.so")
	SET(PHYSX_PHYSXLOADER_LIBRARY "/usr/lib/libPhysXLoader.so")
	SET(PHYSX_PHYSXCORE_LIBRARY "/usr/lib/PhysX/v2.8.1/libPhysXCore.so")
	SET(PHYSX_LIBRARIES ${PHYSX_NXCOOKING_LIBRARY} ${PHYSX_NXCHARACTER_LIBRARY} ${PHYSX_PHYSXLOADER_LIBRARY} ${PHYSX_PHYSXCORE_LIBRARY})
	SET(PHYSX_FOUND "YES")
ENDIF(UNIX)
IF(PHYSX_FOUND)
	SET(PHYSX_INCLUDE_DIRS ${PX_INC} "${PX_INC}/Physics/include" "${PX_INC}/Foundation/include" "${PX_INC}/Cooking/include" "${PX_INC}/NxCharacter/include" "${PX_INC}/PhysXLoader/include")
	if(UNIX)
		set(CMAKE_CXX_FLAGS "-DLINUX -DPHYSX")
	endif(UNIX)
	message("nVidia PhysX found")
ENDIF(PHYSX_FOUND)

